#include "mainedit.h"
#include <QDebug>

MainEdit::MainEdit(QWidget *parent):
    QLineEdit(parent)
{

}

void MainEdit::SetIsDownKeyBoard(bool isNum)
{
    isDownKeyBoard = isNum;
#ifndef WIN32
    QJniObject::callStaticMethod<void>("org/qtproject/barcodetools/QtAndroid",
                                       isNum?"DisableInput":"EnableInput",
                                       "()V");
#endif
}

bool MainEdit::event(QEvent *event)
{
    // 拦截键盘输入法弹起
    // if(event->type() == QEvent::MouseButtonRelease&&isDownKeyBoard){
    //     setFocus();
    //     return true;
    // }
    return QLineEdit::event(event);
}
